package itsmap.systematic.exam;

import java.util.ArrayList;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.TextView;

public class PatientGridClassAdapter extends BaseAdapter {
	private Context mContext;
	private ArrayList<TextView> mGridData;
	
	public PatientGridClassAdapter(Context c, ArrayList<TextView> gridData ){
		mContext = c;
		mGridData = gridData;
	}
	@Override
	public int getCount() {
		return mGridData.size();
	}

	@Override
	public Object getItem(int position) {
		
		return mGridData.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}
	
	
	// Add TextViews here with data.
	// TODO:
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		TextView tv;
		if(convertView == null){
			tv = new EditText(mContext);
			tv.setLayoutParams(new GridView.LayoutParams(85,85));
			tv.setPadding(8, 8, 8, 8);
		}
		else
			tv = (TextView) convertView;
		tv = mGridData.get(position);
		return tv;
	}
	
	

}
